package vpnrouter

import (
	"vpn-management-server/src/controller/vpncontroller"
	"vpn-management-server/src/interceptor/ugroupinterceptor"
	"vpn-management-server/src/interceptor/vpninterceptor"
	"vpn-management-server/src/router/routermodel"
)

var vpnRouter = routermodel.NewRouter()

func init() {
	vpnRouter.RegisterHandleSet("addVpnServerInfo", vpninterceptor.VpnServerInfoValidator, vpncontroller.AddVpnServerInfo, vpninterceptor.AddVpnServerInfoLogToChan)
	vpnRouter.RegisterHandleSet("deleteVpnServerInfo", vpninterceptor.VpnServerInfoNameValidator, vpncontroller.DeleteVpnServerInfo, vpninterceptor.DeleteVpnServerInfoLogToChan)
	vpnRouter.RegisterHandleSet("getUGroupVpnServerInfosByPage", ugroupinterceptor.PageWithIDValidator, vpncontroller.GetUGroupVpnServerInfosByPage, nil)
	vpnRouter.RegisterHandleSet("getVpnServerInfoByUserName", vpninterceptor.GetVpnServerInfoByUserNameValidator, vpncontroller.GetVpnServerInfoByUserName, nil)
	vpnRouter.RegisterHandleSet("getAllVpnServerNameInfos", vpninterceptor.GetAllVpnServerNameInfosValidator, vpncontroller.GetAllVpnServerNameInfos, nil)
	vpnRouter.RegisterHandleSet("getVpnServerInfoByID", vpninterceptor.GetVpnServerInfoByIDValidator, vpncontroller.GetVpnServerInfoByID, nil)
}
